package org.example.system.controller;

import org.example.common.util.web.AjaxResult;
import org.example.system.service.ISysUserService;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 系统用户 前端控制器
 * </p>
 *
 * @author LiJunYi
 * @since 2020-05-25
 */
@RestController
@RequestMapping("/sys/user")
public class SysUserController {

    private final ISysUserService userService;

    public SysUserController(ISysUserService userService) {
        this.userService = userService;
    }

    @PreAuthorize("@ss.hasPermi('sys:user:view')")
    @GetMapping("list")
    public AjaxResult list()
    {
        return AjaxResult.success(userService.list());
    }
}

